<template>
  <el-select
    v-model="selectData"
    allow-create
    default-first-option
    filterable
    :clearable="true"
    @change="tjmcChange"
    placeholder="请选择统计名称">
    <el-option v-for="item in tjmcList" :key="item.id" :label="item.tjmc" :value="item.tjmc"></el-option>
    </el-option>
  </el-select>
</template>

<script>
    import {getTjmcList} from "@/api/statisticsanalysis/fractionGetLeader"; //接口api
    export default {
        name: "",
        data(){
            return{
                selectData:'',
                tjmcList:[],
            }
        },
        created(){
            let str = location.href;
            this.getTjmcData() ;
        },
        methods:{
            tjmcChange(){
                this.$emit('getDataByTjmc',this.selectData)
            } ,
            // 获取考核周期数据
            getTjmcData() {
                getTjmcList({iskq:'0'}) //传参数获取全部周期
                    .then(r => {
                        if (r.data.code == 0) {
                            this.tjmcList =r.data.data ;
                        }
                    })
                    .catch(err => {});
            },
            reset(){
                this.selectData = '' ;
            }
        }
    }
</script>

<style scoped>

</style>
